﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的订单 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link href="<%templateskin%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="{config.webpath}css/pagination.css" rel="stylesheet" type="text/css" />
<link href="{config.webpath}scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/common.js"></script>
</head>

<body>
<!--Header-->
<%template src="_header.html"%>
<!--/Header-->

<div class="section clearfix">
  <div class="line30"></div>

  <div class="info-wrap">
    <!--左侧导航-->
    <%template src="_ucenter_nav.html"%>
    <!--/左侧导航-->
    
    <!--右侧内容-->
    <div class="home-box">
      <%if {action}=="list"%>
      <!--交易订单-->
      <div class="u-tab-head">
        <p>
          <a class="selected" href="<%linkurl("userorder","list")%>">交易订单</a>
          <a href="<%linkurl("userorder","close")%>">已关闭订单</a>
        </p>
      </div>
      <div class="u-tab-content">
        <div class="title-div">
          <strong>交易订单</strong>
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
          <tr>
            <th width="16%" align="left">订单号</th>
            <th align="left">订单商品</th>
            <th width="10%">姓名</th>
            <th width="12%">订单金额</th>
            <th width="11%">下单时间</th>
            <th width="10%">状态</th>
            <th width="12%">操作</th>
          </tr>
          <%set DataTable list=get_order_list(10, page, "user_id="+userModel.id+" and status<=3", out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(10, page, totalcount, "userorder", action, "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in list.Rows)%>
          <tr>
            <td>{dr[order_no]}</td>
            <td>
              <%set List<DTcms.Model.article> ls=get_order_goods_list({strtoint({dr[id]})})%>
              <%if(ls!=null)%>
              <%foreach(DTcms.Model.article modelt in ls)%>
              <a target="_blank" title="{modelt.title}" href="<%linkurl("goods_show",{modelt.id})%>">
                <img width="60" height="60" alt="{modelt.title}" src="{modelt.img_url}" class="img">
              </a>
              <%/foreach%>
              <%/if%>
            </td>
            <td align="center">{dr[accept_name]}</td>
            <td align="center"><strong>￥{dr[order_amount]}</strong><br /><%=get_payment_title({strtoint({dr[payment_id]})})%></td>
            <td align="center">{dr[add_time]}</td>
            <td align="center">
              <%=get_order_status({strtoint({dr[id]})})%>
            </td>
            <td align="center">
              <a href="<%linkurl("userorder_show",{dr[id]})%>">查看订单</a><br />
              <%if(get_order_payment_status({strtoint({dr[id]})}))%>
              <a href="<%linkurl("payment","?action=confirm&order_no="+{dr[order_no]})%>">去付款</a> |
              <%/if%>
              <%if({strtoint({dr[status]})}<2)%>
              <a href="javascript:;" onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=order_cancel&order_no={dr[order_no]}');">取消</a>
              <%/if%>
            </td>
          </tr>
          <%/foreach%>
          <%if(totalcount<1)%>
          <tr>
            <td colspan="8" align="center">暂无记录</td>
          </tr>
          <%/if%>
        </table>
        <div class="page-foot">
          <div class="flickr right">{pagelist}</div><!--放置页码列表-->
        </div>
      </div>
      <!--/交易订单-->
      
      <%else if(action=="close")%>
      <!--已关闭订单-->
      <div class="u-tab-head">
        <p>
          <a href="<%linkurl("userorder","list")%>">交易订单</a>
          <a class="selected" href="<%linkurl("userorder","close")%>">已关闭订单</a>
        </p>
      </div>
      <div class="u-tab-content">
        <div class="title-div">
          <strong>交易订单</strong>
        </div>
        
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
          <tr>
            <th width="16%" align="left">订单号</th>
            <th align="left">订单商品</th>
            <th width="10%">姓名</th>
            <th width="12%">订单金额</th>
            <th width="11%">下单时间</th>
            <th width="10%">状态</th>
            <th width="12%">操作</th>
          </tr>
          <%set DataTable list=get_order_list(10, page, "user_id="+userModel.id+" and status>3", out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(10, page, totalcount, "userorder", action, "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in list.Rows)%>
          <tr>
            <td>{dr[order_no]}</td>
            <td>
              <%set List<DTcms.Model.article> ls=get_order_goods_list({strtoint({dr[id]})})%>
              <%if(ls!=null)%>
              <%foreach(DTcms.Model.article modelt in ls)%>
              <a target="_blank" title="{modelt.title}" href="<%linkurl("goods_show",{modelt.id})%>"><img width="60" height="60" alt="{modelt.title}" src="{modelt.img_url}"></a>
              <%/foreach%>
              <%/if%>
            </td>
            <td align="center">{dr[accept_name]}</td>
            <td align="center"><strong>￥{dr[order_amount]}</strong><br /><%=get_payment_title({strtoint({dr[payment_id]})})%></td>
            <td align="center">{dr[add_time]}</td>
            <td align="center"><%=get_order_status({strtoint({dr[id]})})%></td>
            <td align="center"><a href="<%linkurl("userorder_show",{dr[id]})%>">查看订单</a></td>
          </tr>
          <%/foreach%>
          <%if(totalcount<1)%>
          <tr><td colspan="8" align="center">暂无记录</td></tr>
          <%/if%>
        </table>
    
        <div class="page-foot">
          <div class="flickr right">{pagelist}</div><!--放置页码列表-->
        </div>
      </div>
      <!--/已关闭订单-->
      <%/if%>
    </div>
    <!--/右侧内容-->
  </div>
</div>

<!--Footer-->
<%template src="_footer.html"%>
<!--/Footer-->
</body>
</html>